package cn.caplike.demo.spring.bean.circulardependency;

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class CircularDependencyTest {

    public static void main(String[] args) {
        // 1.获取核心容器对象
        final ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("bean.xml");

        // 2.根据id获取Bean对象
        @SuppressWarnings("unused") final A a = (A) applicationContext.getBean("a");

        // 手动关闭容器, 触发 destroy-method
        applicationContext.close();
    }
}
